import { Express, Response, Request } from "express";
import { readBanner } from "../model/banner";
export default function (app: Express) {
  app.get("/api/getbanner", async function (req: Request, res: Response) {
    const { success, data } = await readBanner();
    if (!success) {
      res.json({ success: false, msg: data.message });
      return;
    }
    res.json({ success: true, data: data });
  });
}
